﻿using System;
using System.ServiceModel;
using WcfServiceLibrary.FaultContract;
using WcfServiceLibrary.Messages;

namespace WcfServiceLibrary
{
    [ServiceContract(SessionMode = SessionMode.Required)]
    public interface IService
    {
        [OperationContract]
        [FaultContract(typeof(ServiceFault))]
        TokenResponse GetToken(TokenRequest request);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginGetToken(TokenRequest request, AsyncCallback callback, object asyncState);

        TokenResponse EndGetToken(IAsyncResult result);

        [OperationContract]
        [FaultContract(typeof(ServiceFault))]
        PersonResponse GetPerson(PersonGetRequest request);

        [OperationContract(AsyncPattern = true)]
        IAsyncResult BeginGetPerson(PersonGetRequest request, AsyncCallback callback, object asyncState);

        PersonResponse EndGetPerson(IAsyncResult result);
    }
}
